//
//  AFRequestJSON.h
//  GraduationProject;
//
//  Created by Sylar on 16/4/13.
//  Copyright © 2016年 伍宏伟. All rights reserved.
//

#import <Foundation/Foundation.h>


/*
 
 Usage:
 
 1.可用便利构造器直接传入id(Delegate)为遵守代理类，可为空
    
    //城市
    AFRequestJSON *model = [AFRequestJSON Delegate:delegate RequestCityWithId:xxxxxx];
    
    //景区
    AFRequestJSON *model = [AFRequestJSON Delegate:delegate  RequestSeneryWithId:xxxxxx];
 
    //执行代理方法可获得返回的JSON字典
 
 
 2.普通init方法
 
    AFRequestJSON *model = [AFRequestJSON alloc]initWithDelegate:delegate ];
    
    //执行代理方法
 
 
 */



@protocol AFRequestJSONDelegate <NSObject>

@optional

//成功获得JSON代理方法
-(void)SeneryJSONSuccessReturn:(NSDictionary*)JSONDictionary;

-(void)CityJSONSuccessReturn:(NSDictionary*)JSONDictionary;


//失败代理方法
-(void)SeneryJSONFailReturn:(NSError*)error;

-(void)CityJSONFailReturn:(NSError*)error;


@end

@interface AFRequestJSON : NSObject

@property(nonatomic,assign)id<AFRequestJSONDelegate> delegate;

//传入风景区ID
-(void)RequestSeneryByImportSceneryId:(NSString*)Id;

//传入城市ID
-(void)RequestCityByImportCityId:(NSString*)Id;

-(id)initWithDelegate:(id)delegate;

+(id)Delegate:(id)Delegate RequestSeneryWithId:(NSString*)id;

+(id)Delegate:(id)Delegate RequestCityWithId:(NSString*)id;


@end
